package com.example.springboot2;

import com.example.springboot2.model.ReadList;
import com.example.springboot2.model.Student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Creat with IntelliJ IDEA
 * Description:
 * User:WZW
 * Date:2022-08-12
 * Time:9:28
 */
@Controller
public class UerController {

    @Value("${server.port}")
    private Integer port;

    @Autowired
    private Student student;

    @Autowired
    private ReadList readList;

    @ResponseBody //返回一个非静态页面的数据
    @RequestMapping("/sayhi")//设置路由地址 不要再url地址中输入大写
    public String sayHi() {
//        return "Hello, World. | port:" + port;
        return "readList:" + readList.getName();
    }
}
